import React from 'react';

import './index.css';
import LayoutView, { LayoutMode } from '../layout';
import Advice from './Advice';
import Detail from './Detail';
import Simulation from './Simulation';
import ReportTab from '../report-tab/ReportTab';

/**
 * 結果詳細：心筋梗塞
 */
const ReportCardiacinfarction = ({inputData, risk, initialRisk, advice, healthy, onCalcRisk, onCancel, defaultSection}) => (
  <LayoutView
    mode={LayoutMode.DETAIL}
    title="心筋梗塞リスク"
    handleBack={onCancel}
    riskLevel={initialRisk.probability.riskLevel}
    className="ReportCardiacinfarction"
  >
    <ReportTab
      category="心筋梗塞"
      defaultSection={defaultSection}
      detailRender={()=>(
        <Detail {...initialRisk} />
      )}
      adviceRender={()=>(
        <Advice {...advice} />
      )}
      simulationRender={()=>(
        <Simulation
          inputData={inputData}
          risk={risk}
          initialRisk={initialRisk}
          onCalcRisk={onCalcRisk}
          healthy={healthy}
        />
      )}
    />
  </LayoutView>
)
/*
ReportCardiacinfarction.propTypes = {
  inputData: React.PropTypes.object.isRequired,
  risk: React.PropTypes.shape({
    probability: React.PropTypes.shape({
      you: React.PropTypes.number.isRequired,
      min: React.PropTypes.number.isRequired,
      max: React.PropTypes.number.isRequired,
    }),
  }),
  initialRisk:  React.PropTypes.shape({
    probability: React.PropTypes.shape({
      you: React.PropTypes.number.isRequired,
      min: React.PropTypes.number.isRequired,
      max: React.PropTypes.number.isRequired,
    }),
  }),
  advice: React.PropTypes.shape({
    allGood: React.PropTypes.shape({
      isAllGood: React.PropTypes.number.isRequired,
    }),

    Advices: React.PropTypes.shape({
      bmiAdvices: React.PropTypes.string,
      bloodSugarAdvices: React.PropTypes.string,
      bloodPressureAdvices: React.PropTypes.string,
      bloodLipidsAdvices: React.PropTypes.string,
      smokingAdvices: React.PropTypes.string,
    }),

    habit: React.PropTypes.shape({
      recommendation: React.PropTypes.string,
    }),

    improveRisk: React.PropTypes.shape({
      you: React.PropTypes.number.isRequired,
      improveBloodSugarRisk: React.PropTypes.number,
      improveBloodPressureRisk: React.PropTypes.number,
      improveSmokingRisk: React.PropTypes.number,
      improveLipidRisk: React.PropTypes.number,
      improveAll: React.PropTypes.number,
      improveCount: React.PropTypes.number.isRequired,
    }),
  }),
  onCalcRisk: React.PropTypes.func,
  onCancel: React.PropTypes.func,
  defaultSection: React.PropTypes.string,
  healthy: React.PropTypes.shape({
    good: React.PropTypes.array,
    bad: React.PropTypes.array,
  }),
};*/

export default ReportCardiacinfarction
